<!DOCTYPE html>

<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>@lang('message.login')</title>
    <link rel="stylesheet" href="{{asset('manger/plugins/layui/css/layui.css')}}" media="all" />
    <link rel="stylesheet" href="{{asset('manger/css/login.css')}}" />
</head>

<body class="beg-login-bg">
<div class="beg-login-box">
    <header>
        <h1>@lang('message.Admin_login')</h1>
    </header>
    <div class="beg-login-main">
        <form action="{{route('admin.login')}}" class="layui-form" method="post">
            {{ csrf_field() }}

            <div class="layui-form-item">
                <label class="beg-login-icon">
                    <i class="layui-icon">&#xe612;</i>
                </label>
                <input type="text" name="email" lay-verify="email" autocomplete="off" placeholder="@lang('message.email')" value="{{old('email')}}" class="layui-input">
            </div>
            <div class="layui-form-item">
                <label class="beg-login-icon">
                    <i class="layui-icon">&#xe642;</i>
                </label>
                <input type="password" name="password" lay-verify="required" autocomplete="off" placeholder="@lang('message.password')" class="layui-input">
            </div>
            <div class="layui-form-item">
                <div class="beg-pull-left beg-login-remember">
                    <label>@lang('message.remember_me')？</label>
                    <input type="checkbox" name="remember" value="{{old('remember') ? old('remember') : 'true' }}" lay-skin="switch" checked title="@lang('message.remember_me')" >
                </div>
                <div class="beg-pull-right">
                    <button class="layui-btn layui-btn-primary" lay-submit lay-filter="login">
                        <i class="layui-icon">&#xe650;</i>
                        @lang('message.login')
                    </button>
                </div>
                <div class="beg-clear"></div>
            </div>
        </form>
    </div>
    <footer>
        <p></p>
    </footer>
</div>
<script type="text/javascript" src="{{asset('manger/plugins/layui/layui.js')}}"></script>
<script>
    layui.use('form',function(){
       var form=layui.form();
        form.verify({
            email: [
                /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/
                ,'@lang('message.email_exp')'
            ]
        })
    })
    layui.use(['layer'], function() {
        var layer = layui.layer,
            $ = layui.jquery;
          //  form = layui.form();
        //    form.submit();

//        form.on('submit(login)',function(data){
//
//            location.href='index.html';
//            return false;
//        });
    });
    //验证错误
    @if (count($errors) > 0)
    layui.use('layer', function(){
        var layer = layui.layer;
        @foreach ($errors->all() as $error)
        layer.msg('{{$error}}', {icon: 5},function () {

        });
        @endforeach

    });
    @endif
</script>
</body>

</html>